package cn.com.dhee.springcloudtraining.gateway.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ralphwong
 */
@RestController
public class FallbackController {
    private Logger logger = LoggerFactory.getLogger(FallbackController.class);

    /**
     *
     * @return
     */
    @RequestMapping("/defaultfallback")
    public Map<String,Object> defaultfallback(){
        logger.info("降级操作...");
        Map<String,Object> map = new HashMap<>(3);
        map.put("code",200);
        map.put("msg","服务超时降级");
        map.put("data",null);
        return map;
    }
}
